import time
from concurrent.futures import ProcessPoolExecutor


def func(name: str):
    print(f"{name} - step - 1\n", end="")
    time.sleep(1)
    print(f"{name} - step - 2\n", end="")
    return f"{name} - done"


def main():
    # with ProcessPoolExecutor() as executor:
    #     result1 = executor.submit(func, "Process-1")
    #     result2 = executor.submit(func, "Process-2")
    #
    #     print(result1.result())
    #     print(result2.result())

    with ProcessPoolExecutor() as executor:
        result = executor.map(func, ["thread-1", "thread-2"])

        for res in result:
            print(res)


if __name__ == '__main__':
    print(time.perf_counter())
    main()
